﻿<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Demo.Services.Contracts.DTO.Infos.AreaInfo>>" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<html>
<head id="Head1" runat="server">
    <title>Area</title>
</head>
<body>
    <h2>
        Index</h2>
    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>
     <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Store ID="dsAreas" runat="server">
        <Proxy>
            <ext:AjaxProxy Url="/Area/GetAreas/" >            
            <ActionMethods Read="POST"></ActionMethods>
                <Reader >
                    <ext:JsonReader Root="data" TotalProperty="total"  />
                </Reader>
            </ext:AjaxProxy>
        </Proxy>

        <Model>
            <ext:Model ID="Model1" runat="server">
                <Fields>
                    <ext:ModelField Name="Id" />
                    <ext:ModelField Name="Descripcion" />
                </Fields>
            </ext:Model>
        </Model>
    </ext:Store>
    <ext:GridPanel ID="GridPanel1" runat="server" Header="false" Border="false" StoreID="dsAreas">
        <ColumnModel ID="ColumnModel1"  runat="server">
            <Columns>
                <ext:Column runat="server" ColumnID="Id" DataIndex="Id" Header="ID" />
                <ext:Column runat="server" ColumnID="Descripcion" DataIndex="Descripcion" Header="Descripcion" />
            </Columns>
        </ColumnModel>
        <SelectionModel>
            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
        </SelectionModel>
        <BottomBar>
            <ext:PagingToolbar ID="PagingToolbar1" runat="server" StoreID="dsAreas" PageSize="15" />
        </BottomBar>
    </ext:GridPanel>
</body>
</html>
